CREATE OR REPLACE FUNCTION corner00_dec(de DOUBLE PRECISION,size_de DOUBLE PRECISION) RETURNS DOUBLE PRECISION IMMUTABLE AS $$
DECLARE 
	d DOUBLE PRECISION := (de - (size_de/2));
BEGIN
  IF d < -90 THEN 
    RETURN (-180. - d);
  ELSE 
    RETURN d;
  END IF;
END;
$$ LANGUAGE 'plpgsql';